﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SzCourt.Logic.BLL;

namespace SzCourt.WebSite.shenwu.login
{
    public partial class success : System.Web.UI.Page
    {
        private string _Name = string.Empty;
        private string _Password = string.Empty;
        private string _Shenfen = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                getParam();
                createrInfo();
            }
        }

        //获取参数值
        private void getParam()
        {
            this._Name = string.IsNullOrEmpty(Request.Form["txtName"]) ? "" : Request.Form["txtName"];
            this._Password = string.IsNullOrEmpty(Request.Form["txtPassword"]) ? "" : Request.Form["txtPassword"];
            this._Shenfen = string.IsNullOrEmpty(Request.Form["txtShenfen"]) ? "" : Request.Form["txtShenfen"];
        }

        private void createrInfo()
        {
            UserInfo bll = new UserInfo();
            bool result = (bool)bll.CreateUser(this._Name, this._Password, this._Shenfen, UserTypes.GENERAL);

            
            if (result)
            {
                this.spMessage.InnerHtml = "用户注册成功！";
            }
            else
            {
                this.spMessage.InnerHtml = "用户注册失败！";
            }
        }

    }
}